package com.jindun.paper.ui.handler;

import org.eclipse.core.commands.ExecutionEvent;
import org.eclipse.core.commands.ExecutionException;
import org.eclipse.core.commands.AbstractHandler;
import org.eclipse.jface.dialogs.Dialog;
import org.eclipse.ui.PlatformUI;

import com.jindun.paper.ui.client.ClientEditorDialog;
import com.jindun.paper.ui.client.ClientListView;

public class ClientAddHandler extends AbstractHandler {

	@Override
	public Object execute(ExecutionEvent event) throws ExecutionException {

		ClientEditorDialog dialog = new ClientEditorDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow(), null);
		if (dialog.open() == Dialog.OK) {
			ClientListView clientListView = (ClientListView)PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().findView("clientListView");
			clientListView.refresh();
		}
		
		return null;
	}

	

}
